<% content_for :convo_header do %>
<div id="convo_header_container">
  <div id="convo_header" >
    <h5>
	    <% if @conversation.private? %><%= image_tag("/images/icons/icono_candado.gif") %> <% end %>
	  	<% if @conversation.read_only %><span class="label">RO</span> <% end %><%= link_to h(@conversation.name), conversation_path(@conversation) %>
	  </h5>
	  <div id="convo_tools">
	    <div class="padding05">
	      <%= render :partial => 'conversations/star', :locals => { :conversation => @conversation } %>
	      <% if @conversation.parent_message_id %>
    	    <span class="sbutton round"><%= link_to t("ui.back_to_parent"), conversation_path(@conversation.parent_message.conversation)%></span>
    	  <% end %>
        <span class="sbutton round"><%= render :partial => 'subscriptions/follow', :locals => { :conversation => @conversation } %></span>

        <%# filter here %>
  		</div>
  	</div>
	  
  </div>
</div>
<% end %>



<div>
	<h5>Send invitations by email <%= image_tag "/images/icons/spinner.gif", :style => 'display:none;', :id => "spinner_y" %></h5>
	write some email addresses in the text box and click on the invite button
		<% form_remote_tag :url => invite_via_email_conversation_path(@conversation), :loading => "$('spinner_y').show();" do %> 
			<%= text_area :emails, {}, :cols => 30, :rows => 3 %>
			<%= submit_tag t("ui.invite") %> 
		<% end %>
    
</div>



<%if @conversation.public? %>
<div>
	  <div class="big center vspace">
	    <span class="round button">	
		  <%= link_to_remote t("users.invite_all_followers"), :url => invite_all_my_followers_conversation_path(@conversation),
   	  	  :confirm => t("users.invite_all_followers") + "?",
		      :loading => "$('spinner_0').show();",
      	  :method => :post %>	
      <%= image_tag "/images/icons/spinner.gif", :style => 'display:none;', :id => "spinner_x" %>
      </span>
    </div>
</div>
<%end%>

<div class="item">
  <h6><%= t("users.my_followers") %></h6>
  
  <ul id="users_list">
    <% @users.each do |user|%>
	    <li id="<%=dom_id user%>">
    		<span class="avatar">
    		  <%= link_to image_tag(user.gravatar_url, :border => 0, :width => 40, :height => 40, :class => "avatar", :alt => user.login), user_path(user),
    		    :class => 'tip', 
    		    :title =>  t("users.since") + user.date  + 
    		      '<br/>' + user.conversations.size.to_s  + '&nbsp;' + t('ui.convos') +
    		      '<br/>' + user.messages.size.to_s       + '&nbsp;' + t('ui.messages') +
    		      '<br/>' + user.subscriptions.size.to_s  + '&nbsp;' + t("ui.following") +
    		      '<br/>' + user.followers.size.to_s      + '&nbsp;' + t("ui.followers")
    		  %>
    		</span>
        <span class="username">
          <%=link_to h(user.login), user_path(user) %> &#187;
        	<%= link_to_remote t("ui.invite"), :url => invite_from_list_conversation_path(@conversation, :user_id => user.id),
        	  :loading => "$('link_#{user.id}').hide();$('spinner_#{user.id}').show();",
        	  :html => {:id => "link_#{user.id}"},
        	  :method => :post %>
        	<%= image_tag "/images/icons/spinner.gif", :style => 'display:none;', :id => "spinner_#{user.id}" %>
        </span>
        <span class="user_real_name">
          <%= user.name unless user.name == user.login %>
        </span>
      </li>
	  <%end%>
  </ul>
  <div class="clear"></div>
</div>
